package com.smssalama;

import com.smssalama.storage.contact.ContactsDisplayNameCache;
import com.smssalama.storage.framework.ObjectStore;

/**
 * An interface to be implemented by provider of user specific information.
 * 
 * @author Arnold P. Minde
 *
 */
public interface IUserProfile {
	/**
	 * The {@link ObjectStore} for contacts associated with the user.
	 * 
	 * @return
	 */
	ObjectStore getContactsStore();

	/**
	 * The {@link ObjectStore} for messages associated with the user.
	 * 
	 * @return
	 */
	ObjectStore getMessagesStore();

	/**
	 * The {@link ContactsDisplayNameCache} for contacts associated with the user.
	 * 
	 * @return
	 */
	ContactsDisplayNameCache getDisplayNameCache();

	/**
	 * Changes the user's password
	 * 
	 * @param oldPassword
	 * @param newPassword
	 * @return <code>true</code> if the password was change. Returns <code>false</code> otherwise.
	 */
	boolean changePassword(String oldPassword, String newPassword);
	
	/**
	 * Returns the locale assosiated with the user
	 * @return
	 */
	String getLocale();
	
	/**
	 * Sets the locale associated with the user
	 */
	void setLocale(String locale);
	
	boolean authenticate(String password);
}
